<?php 


function login($login)
{
	if(!isset($_SESSION['accounts']))
	{
		echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
		echo "<script type='text/javascript'>alert('$login');location.href='login.html'</script>";
	}
	if($_SESSION['agencylv']!=100)
	{
		echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
		echo "<script type='text/javascript'>alert('您好，您的权限不足');location.href='http://".$_SERVER['SERVER_NAME']."/zy_agent/login.html'</script>";
	}	
}
function times()
{
		$sdate=$_POST['sdate'];																		//POST来的时间转为时间戳
		$edate=$_POST['edate'];																		//POST来的时间转为时间戳
		$arr['times']=array('between',array($sdate,$edate));															//判断大于等于起始时间的条件
}

function gura($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');location.href='grabble.html'</script>";die;
}



function deduct($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');location.href='deduct.html'</script>";die;
}
function change($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');location.href='supervise.html'</script>";die;
}

function error($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');history.go(-1)</script>";die;
}

function prompt($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');location.href='prompt.html'</script>";die;
}

function login_error($login)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$login');location.href='login.html'</script>";
}


function activityOne($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');location.href='activityOne.html'</script>";
}

function activityTwo($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');location.href='activityTwo.html'</script>";
}

function activityThree($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');location.href='activityThree.html'</script>";
}

function activityFour($error)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('$error');location.href='activityFour.html'</script>";
}

function gems($gems)
{
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	echo "<script type='text/javascript'>alert('当前用户需积累".$gems."可获得返利，请先清空后，再更改返利条件条件');history.go(-1)</script>";die;
}

function Retained($Retained) {
			
       foreach ($Retained as $key) {
			foreach ($key as $val) {
				$player[] = $val;
			}
		}
      return $player;
}

function object_array($array) {  //把stdClass Object转array
    if(is_object($array)) {  
        $array = (array)$array;  
     } if(is_array($array)) {  
         foreach($array as $key=>$value) {  
             $array[$key] = object_array($value);  
             }  
     }  
     return $array;  
}

?>